import request from '@/utils/request'
/**
 * 商品详细
 * @param {*} id
 * @returns
 */
export const findGoods = (id) => {
  return request('/goods', 'get', { id })
}
/**
 *
 * @param {string} id商品id获取同类商品推荐
 * @returns  limit:商品数量
 */
export const similarToRecommend = ({ id, limit = 16 }) => {
  return request('/goods/relevant', 'get', { id, limit })
}
/**
 *
 * @param {*} id
 * @param {*} type 热榜类型
 * @returns  热榜推荐
 */
export const hotSales = (id, type) => {
  return request('/goods/hot', 'get', { id, limit: 3, type })
}
/** 商品评价
 * mock模拟后台数据
 * @param {*} id 商品id
 */
export const findevaluat = (id) => {
  return request(`/goods/${id}/evaluate`, 'get')
}
/** 商品评价列表数据
 * mock模拟后台数据
 * @param {*} id 商品id
 */
// export const goodsList = (id, params) => {
//   // https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page
//   return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', params)
// }
export const goodsList = (id, params) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', params)
}
